#ifndef _TEST_CLASS_INITIALIZER_H_
#define _TEST_CLASS_INITIALIZER_H_

#include "TestHeader.h"

class TestCase;

class TestClassInitializer
{
    private:
        typedef TestCase* (runtimeCreateFunType)();
        
    public:
       TestClassInitializer(std::string className, runtimeCreateFunType *fun);
       static TestCase* createTestCase(std::string className);

    private:
        static std::map <std::string, runtimeCreateFunType*>& _getRegTestClasses();
};


#define REG_TEST_CLASS(className) \
    TestCase* __createFun__##className() { return new className(); } \
    static TestClassInitializer __initialVar__##className(#className, &__createFun__##className)

#endif


